DIRegEx v8.6.9 for D4-XE10
DIRegEx is a library of components and procedures that implement regular expression pattern matching using the same syntax and semantics as Perl for Delphi (Embarcadero / CodeGear / Borland).
DIRegEx offers two regular expression algorithms with their corresponding wrapper classes for easy usage:
TDIPerlRegEx implements a matching algorithm with the same syntax and semantics as Perl. Consider this the standard algorithm which you are used to from Perl and JavaScript. It is very fast and supports the complete pattern syntax. You will very likely be using it most of the time.
TDIDfaRegEx implements the DFA matching algorithm. Considerer this as a special purpose algorithm. If finds all possible matches and in particular, it finds the longest. It never needs to backtrack and supports partial matching much better, even for very long subject strings in several pieces.
Both classes descend from a common ancestor TDIRegEx which implements the complete functionality for working with regular expressions, regardless of which algorithm is currently in effect:
- Matching and extraction of matches / substrings from the source text.
- Searching for regular expressions within streams and memory buffers. To search within streams or files (of virtually unlimited size), use one of the specially optimized
TDIRegExSearchStreamclass descendents. - Replacements on full and partial matches / substrings.
- Listing of full and partial matches / substrings.
- Formatting of matches.
DIRegEx 8.6.9 – 7 Mar 2016
- If PCRE_AUTO_CALLOUT was set on a pattern that had a
(?#comment between an item and its qualifier (for example,A(?#comment)?B)pcre_compile misbehaved. - Similar to the above, if an isolated
\Ewas present between an item and its qualifier when PCRE_AUTO_CALLOUT was set, pcre_compile misbehaved. - Negated classes such as
[^[:^ascii:]\d]were not working correctly in UCP mode. - An empty
\Q\Esequence between an item and its qualifier caused pcre_compile to misbehave when auto callouts were enabled. - If a pattern that was compiled with PCRE_EXTENDED started with white space or a
#-type comment that was followed by(?-x), which turns off PCRE_EXTENDED, and there was no subsequent(?x)to turn it on again, pcre_compile assumed that(?-x)applied to the whole pattern and consequently mis-compiled it. - A call of pcre_copy_named_substring for a named substring whose number was greater than the space in the ovector could cause a crash.
- Fix a buffer overflow bug which involved duplicate named groups with a group that reset capture numbers.
- pcre_get_substring_list crashed if the use of
\Kin a match caused the start of the match to be earlier than the end. - Improvements to JIT.
- A pattern that included
(*ACCEPT)in the middle of a sufficiently deeply nested set of parentheses of sufficient size caused an overflow of the compiling workspace (which was diagnosed, but of course is not desirable). - Fix a buffer overflow bug involving nested duplicate named groups with a nested back reference.
- An invalid pattern fragment such as
(?(?C)0was not diagnosing an error (“assertion expected”) when(?(?C)was not followed by an opening parenthesis.
